import { createI18n } from "vue-i18n";
// import store from "@/store";
import mZhLocal from "./lang/zh.ts";
import mEnLocal from "./lang/en.ts";

const messages = {
  en: {
    msg: {
      ...mEnLocal,
    },
  },
  zh: {
    msg: {
      ...mZhLocal,
    },
  },
};

// 初始化i18n实例

const i18n = createI18n({
  // 使用 composition API模式，则需要将其设置为false
  legacy: false,
  // 全局注入$t函数
  globalInjection: true,
  // locale: (store.getters && store.getters.language) || 'zh',
  locale: "zh",
  messages,
});

export default i18n;
